package com.cs.widgetvp.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.cs.widgetvp.R;

import org.jetbrains.annotations.NotNull;

import java.util.List;


/**
 *
 */
public class HomeJokeVpAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public HomeJokeVpAdapter(Context context,List<String> list) {
        super(R.layout.home_joke_vp_item,list);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, String s) {
        holder.setText(R.id.tv_joke,s);
        if(holder.getLayoutPosition()==0){
            holder.setImageResource(R.id.picture,R.drawable.slide_1);
        }else if(holder.getLayoutPosition()==1){
            holder.setImageResource(R.id.picture,R.drawable.slide_2);
        }else if(holder.getLayoutPosition()==2){
            holder.setImageResource(R.id.picture,R.drawable.slide_3);
        }
    }

}
